Gui.runCommand('Std_Workbench',9)
Gui.runCommand('Std_ViewStatusBar',1)
import ImportGui
ImportGui.insert(u"//desktop-xtvpxnt/quadA-use2/wucha/iron-2.STEP","未命名")
# App.setActiveDocument("Unnamed")
# App.ActiveDocument=App.getDocument("Unnamed")
# Gui.ActiveDocument=Gui.getDocument("Unnamed")
Gui.runCommand('Std_OrthographicCamera',1)
# Gui.Selection.addSelection('Unnamed','Part__Feature','Face184',-158.382,-162.302,81.5)
### Begin command PartDesign_Body
App.activeDocument().addObject('PartDesign::Body','Body')
App.activeDocument().Body.BaseFeature = App.activeDocument().Part__Feature
import PartDesignGui
Gui.activateView('Gui::View3DInventor', True)
Gui.activeView().setActiveObject('pdbody', App.activeDocument().Body)
Gui.Selection.clearSelection()
Gui.Selection.addSelection(App.ActiveDocument.Body)
App.ActiveDocument.recompute()
### End command PartDesign_Body
# Gui.Selection.addSelection('Unnamed','Body')
# Gui.Selection.clearSelection()
# Gui.Selection.addSelection('Unnamed','Body','BaseFeature.')
# Gui.Selection.clearSelection()
# Gui.Selection.addSelection('Unnamed','Body','',-139.564,129.371,81.5)
# Gui.Selection.clearSelection()
# Gui.Selection.addSelection('Unnamed','Body','BaseFeature.Face184',-134.86,181.12,81.5)
# Gui.Selection.clearSelection()
# Gui.Selection.clearSelection()
# Gui.Selection.clearSelection()
# Gui.Selection.addSelection('Unnamed','Body','BaseFeature.Edge410',-339.437,49.3963,81.5)
# Gui.Selection.clearSelection()
# Gui.Selection.addSelection('Unnamed','Body','BaseFeature.Edge409',-339.437,-77.6227,81.5)
# Gui.Selection.clearSelection()
# Gui.Selection.clearSelection()
# Gui.Selection.addSelection('Unnamed','Body','BaseFeature.Face184',-271.288,143.484,81.5)
### Begin command PartDesign_NewSketch
App.getDocument('Unnamed').getObject('Body').newObject('Sketcher::SketchObject','Sketch')
App.getDocument('Unnamed').getObject('Sketch').Support = (App.getDocument('Unnamed').getObject('BaseFeature'),['Face184',])
App.getDocument('Unnamed').getObject('Sketch').MapMode = 'FlatFace'
App.ActiveDocument.recompute()
Gui.getDocument('Unnamed').setEdit(App.getDocument('Unnamed').getObject('Body'),0,'Sketch.')
import Show
ActiveSketch = App.getDocument('Unnamed').getObject('Sketch')
tv = Show.TempoVis(App.ActiveDocument, tag= ActiveSketch.ViewObject.TypeId)
ActiveSketch.ViewObject.TempoVis = tv
if ActiveSketch.ViewObject.EditingWorkbench:
  tv.activateWorkbench(ActiveSketch.ViewObject.EditingWorkbench)
if ActiveSketch.ViewObject.HideDependent:
  tv.hide(tv.get_all_dependent(App.getDocument('Unnamed').getObject('Body'), 'Sketch.'))
if ActiveSketch.ViewObject.ShowSupport:
  tv.show([ref[0] for ref in ActiveSketch.Support if not ref[0].isDerivedFrom("PartDesign::Plane")])
if ActiveSketch.ViewObject.ShowLinks:
  tv.show([ref[0] for ref in ActiveSketch.ExternalGeometry])
tv.hide(ActiveSketch)
del(tv)
del(ActiveSketch)

import PartDesignGui
ActiveSketch = App.getDocument('Unnamed').getObject('Sketch')
if ActiveSketch.ViewObject.RestoreCamera:
  ActiveSketch.ViewObject.TempoVis.saveCamera()

### End command PartDesign_NewSketch
# Gui.Selection.clearSelection()
Gui.getDocument('Unnamed').resetEdit()
App.ActiveDocument.recompute()
ActiveSketch = App.getDocument('Unnamed').getObject('Sketch')
tv = ActiveSketch.ViewObject.TempoVis
if tv:
  tv.restore()
ActiveSketch.ViewObject.TempoVis = None
del(tv)
del(ActiveSketch)

# Gui.Selection.addSelection('Unnamed','Body','Sketch.')
App.getDocument('Unnamed').recompute()
# Gui.Selection.clearSelection()
# Gui.Selection.addSelection('Unnamed','Body','BaseFeature.Face183',-129.157,293.286,-81.5)
# Gui.Selection.clearSelection()
# Gui.Selection.addSelection('Unnamed','Body','Sketch.')
### Begin command Std_Delete
App.getDocument('Unnamed').removeObject('Sketch')
App.getDocument('Unnamed').recompute()
### End command Std_Delete
# Gui.Selection.clearSelection()
Gui.runCommand('PartDesign_NewSketch',0)
# Gui.Selection.addSelection('Unnamed','Body','BaseFeature.')
# Gui.Selection.clearSelection()
# Gui.Selection.addSelection('Unnamed','Body','',-114.049,173.678,-81.5)
# Gui.Selection.clearSelection()
# Gui.Selection.addSelection('Unnamed','Body','BaseFeature.Face183',-172.571,168.17,-81.5)
### Begin command PartDesign_NewSketch
App.getDocument('Unnamed').getObject('Body').newObject('Sketcher::SketchObject','Sketch')
App.getDocument('Unnamed').getObject('Sketch').Support = (App.getDocument('Unnamed').getObject('BaseFeature'),['Face183',])
App.getDocument('Unnamed').getObject('Sketch').MapMode = 'FlatFace'
App.ActiveDocument.recompute()
Gui.getDocument('Unnamed').setEdit(App.getDocument('Unnamed').getObject('Body'),0,'Sketch.')
ActiveSketch = App.getDocument('Unnamed').getObject('Sketch')
tv = Show.TempoVis(App.ActiveDocument, tag= ActiveSketch.ViewObject.TypeId)
ActiveSketch.ViewObject.TempoVis = tv
if ActiveSketch.ViewObject.EditingWorkbench:
  tv.activateWorkbench(ActiveSketch.ViewObject.EditingWorkbench)
if ActiveSketch.ViewObject.HideDependent:
  tv.hide(tv.get_all_dependent(App.getDocument('Unnamed').getObject('Body'), 'Sketch.'))
if ActiveSketch.ViewObject.ShowSupport:
  tv.show([ref[0] for ref in ActiveSketch.Support if not ref[0].isDerivedFrom("PartDesign::Plane")])
if ActiveSketch.ViewObject.ShowLinks:
  tv.show([ref[0] for ref in ActiveSketch.ExternalGeometry])
tv.hide(ActiveSketch)
del(tv)
del(ActiveSketch)

import PartDesignGui
ActiveSketch = App.getDocument('Unnamed').getObject('Sketch')
if ActiveSketch.ViewObject.RestoreCamera:
  ActiveSketch.ViewObject.TempoVis.saveCamera()

### End command PartDesign_NewSketch
# Gui.Selection.clearSelection()



App.getDocument('Unnamed').getObject('Sketch').addExternal("BaseFeature","Edge231")